Plots the surrogate predictive function (SPF), i.e.,
# S3 method for SPF.BinBin
plot(x, Type="All.Histograms", Specific.Pi="r_0_0", Col="grey",
Box.Plot.Outliers=FALSE, Legend.Pos="topleft", Legend.Cex=1, ...)
A fitted object of class SPF.BinBin
. See ICA.BinBin
.
The type of plot that is requested. Possible choices are: Type="All.Histograms"
, the histograms of all Type="All.Densities"
, plots of densities of all Type="Histogram"
, the histogram of a particular Specific.Pi=
argument has to be used to specify the desired Type="Density"
, the density of a particular Specific.Pi=
argument has to be used to specify the desired Type="Box.Plot"
, a box plot of all Type="Lines.Mean"
, a line plot the depicts the means of all Type="Lines.Median"
, a line plot the depicts the medians of all Type="Lines.Mode"
, a line plot the depicts the modes of all Type="3D.Mean"
, a 3D bar plot the depicts the means of all Type="3D.Median"
, a 3D bar plot the depicts the medians of all Type="3D.Mode"
, a 3D bar plot the depicts the modes of all Type="3D.Spinning.Mean"
, a spinning 3D plot that depicts the means of all Type="3D.Spinning.Median"
, a spinning 3D plot that depicts the medians of all Type="3D.Spinning.Mode"
, a spinning 3D plot that depicts the modes of all
When Type="Histogram"
or Type="Density"
, the histogram/density of a particular Specific.Pi=
argument is used to specify the desired r_0_0
.
The color of the bins or lines when histograms or density plots are requested. Default "grey"
.
Logical. Should outliers be depicted in the box plots?. Default FALSE
.
Position of the legend when a type="Box.Plot"
, type="Lines.Mean"
, type="Lines.Median"
, or type="Lines.Mode"
is requested. Default "topleft"
.
Size of the legend when a type="Box.Plot"
, type="Lines.Mean"
, type="Lines.Median"
, or type="Lines.Mode"
is requested. Default 1
.
Arguments to be passed to the plot, histogram, ... functions.
Alonso, A., Van der Elst, W., & Molenberghs, G. (2015). Assessing a surrogate effect predictive value in a causal inference framework.
# NOT RUN {
# Generate plausible values for Pi
ICA <- ICA.BinBin.Grid.Sample(pi1_1_=0.341, pi0_1_=0.119,
pi1_0_=0.254, pi_1_1=0.686, pi_1_0=0.088, pi_0_1=0.078, Seed=1,
Monotonicity=c("General"), M=2500)
# Compute the surrogate predictive function (SPF)
SPF <- SPF.BinBin(ICA)
# Explore the results
summary(SPF)
# Examples of plots
plot(SPF, Type="All.Histograms")
plot(SPF, Type="All.Densities")
plot(SPF, Type="Histogram", Specific.Pi="r_0_0")
plot(SPF, Type="Box.Plot", Legend.Pos="topleft", Legend.Cex=.7)
plot(SPF, Type="Lines.Mean")
plot(SPF, Type="Lines.Median")
plot(SPF, Type="3D.Mean")
plot(SPF, Type="3D.Median")
plot(SPF, Type="3D.Spinning.Mean")
plot(SPF, Type="3D.Spinning.Median")
# }
Run the code above in your browser using DataLab